<?php


/**
* Puree CMS
* http://www.molotsoft.ru
*
* @package Puree_CMS
* @subpackage Admin/Elements
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: admin_content_message.ctp 980 2010-03-19 07:40:29Z molotsoft@gmail.com $
* @link $HeadURL: http://puree-cms.googlecode.com/svn/trunk/plugins/admin/views/elements/layouts/admin_content_message.ctp $
*/


//$session->flash();

// flash
if ($session->check('Message.flash')) {
	$flash = $session->read('Message.flash');
	$session->del('Message.flash');
	echo '<div id="flashMessage" class="message message_container">' . __($flash['message'], TRUE) . '</div>';
}

// status
if ($session->check('Message.status')) {
	$status = $session->read('Message.status');
	$session->del('Message.status');
	$success_messages = array(
		CODE_SUCCESS => __('code_success_message', TRUE),
		CODE_ADDED => __('code_added_message', TRUE),
		CODE_EDITED => __('code_edited_message', TRUE),
		CODE_DELETED => __('code_deleted_message', TRUE),
		CODE_ACCEPTED => __('code_accepted_message', TRUE)
	);
	$error_messages = array(
		CODE_ERROR => __('code_error_message', TRUE),
		CODE_NOT_FOUND => __('code_not_found_message', TRUE),
		CODE_FORBIDDEN => __('code_forbidden_message', TRUE)
	);
	if (isset($success_messages[$status])) {
		echo '<div id="flashMessage" class="message message_container message_success">' . $success_messages[$status] . '</div>';
	} elseif (isset($error_messages[$status])) {
		echo '<div id="flashMessage" class="message message_container message_error">' . $error_messages[$status] . '</div>';
	}
}


?>